import React, { Component } from 'react';
import { home_nav } from '../uilt/api';
class Madte extends Component {
    state={
        catelist:[]
    }
    componentDidMount(){
        home_nav().then((res)=>{
            this.setState({
                catelist:res.data.list
            })
        })
    }
    render() {
        return (
            <div className='mate'>
            {
                this.state.catelist&&this.state.catelist.length>0&&
                this.state.catelist.map((item,index)=>{
                    return (
                        <div className="cate" key={index}>
                            <img src={item.pic} alt="" />
                            <div className="name">{item.name}</div>
                        </div>
                    )
                })
            }
            </div>
        );
    }
}

export default Madte;